<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>搜索机构</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__/dropload.css"/>

    <style>
        .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.7rem;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 19px 19px;
        }

        .aui-bar-nav .aui-iconfont1 {
            position: relative;
            z-index: 20;
            font-size: 0.9rem;
            color: #ffffff;
            line-height: 2.4rem;
            padding-left: 0.75rem;
        }

        .aui-searchbar {
            display: -webkit-box;
            -webkit-box-pack: center;
            -webkit-box-align: center;
            height: 2.4rem;
            overflow: hidden;
            width: 98%;
            background-color: #ffffff;
            color: #9e9e9e;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        .aui-searchbar-input {
            margin-right: 2.5rem;
            background-color: #F5F7F8;
            border-radius: 1rem;
            height: 30px;
            line-height: 30px;
            font-size: 0.7rem;
            position: relative;
            /*padding-left: 0.0rem;*/
            display: -webkit-box;
            -webkit-box-flex: 1;
            /*padding-right:1.0rem;*/
        }

        .aui-searchbar-input input {
            color: #999999;
            width: 100%;
            padding: 0;
            margin: 0;
            height: 1.5rem;
            line-height: normal;
            border: 0;
            -webkit-appearance: none;
            font-size: 0.7rem;
            background-color: #ffffff;
        }

        .aui-searchbar .aui-iconfont {
            line-height: 1.50rem;
            color: #9e9e9e !important;
        }

        .aaa {
            height: 1.5rem;
            line-height: 1.5rem;
            font-size: 13px;
            color: #333333 !important;
            display: inline-block;
            vertical-align: top;
            margin-top: 2px;
            margin-left: 10px;
        }

        .aui-icon-search:before {
            content: '';
            width: 10px;
            height: 1.50rem;
            background: url('__IMG__xiala.png') no-repeat center center;
            background-size: 10px 10px;
            display: inline-block;
        }

        .aui-bar-nav .aui-title {
            min-height: 2.4rem;
            position: absolute;
            margin: 0;
            text-align: center;
            white-space: nowrap;
            right: 0.75rem;
            left: 1.5rem;
            /* width: auto; */
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 2;
        }

        .pposition {
            min-height: 2.4rem;
            position: absolute;
            margin: 0;
            text-align: center;
            white-space: nowrap;
            /*right: 0.75rem;*/
            left: 0rem;
            width: 12rem;
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 2;
        }

        .pposition_left {
            float: left;
            width: 0.75rem;
            height: 0.7rem;
            margin-top: 0.85rem;
        }

        .eara {
            float: left;
            color: #4F3E37;
            font-size: 14px;
            margin: 0 0.2rem;
        }

        .pposition_right {
            float: left;
            width: 0.75rem;
            height: 0.7rem;
            margin-top: 0.85rem;
        }

        .aui-icon-rightu {
            height: 2.4rem;
            width: 49px;
            /*margin-top:0.1rem;*/
            margin-right: 0.2rem;
        }

        .aui-searchbar {
            display: -webkit-box;
            -webkit-box-pack: center;
            -webkit-box-align: center;
            height: 2.35rem;
            overflow: hidden;
            width: 98%;
            background-color: #ffffff;
            color: #9e9e9e;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }

        .aui-searchbar-input {
            margin-right: 2.5rem;
            background-color: #F5F7F8;
            border-radius: 1rem;
            height: 30px;
            line-height: 30px;
            font-size: 0.7rem;
            position: relative;
            /*padding-left: 0.0rem;*/
            display: -webkit-box;
            -webkit-box-flex: 1;
            /*padding-right:1.0rem;*/
        }

        .aui-searchbar-input input {
            color: #999999;
            width: 100%;
            padding: 0;
            margin: 0;
            height: 1.5rem;
            line-height: normal;
            border: 0;
            -webkit-appearance: none;
            font-size: 0.7rem;
            background-color: #ffffff;
        }

        .aui-searchbar .aui-iconfont {
            line-height: 1.50rem;
            color: #9e9e9e !important;
        }

        .shaa {
            width: 5rem;
            height: 5rem;
            position: absolute;
            z-index: 999;
            left: 2.5rem;
            top: 4rem;
            background-color: #FFFFFF;
            font-size: 0.75rem;
            line-height: 2.5rem;
            text-align: center;
            border-radius: 5px;
            box-shadow: 2.5px 5px 6.5px rgba(246, 246, 246, 1);
            display: none;
        }

        .warrp {
            width: 100%;
            padding: 0.75rem 0.75rem;
            background-color: #fff;
        }

        .cooc {
            width: 100%;
            display: flex;
            padding-bottom: 0.75rem;
        }

        .header {
            width: 5rem;
            height: 5rem;
        }

        .title {
            font-size: 0.75rem;
            color: #333333;
            line-height: 1.1rem;
        }

        .cont {
            font-size: 0.7rem;
            color: #666666;
            line-height: 0.85rem;
        }

        /*活动*/
        .activity {
            padding: 0.7rem 0.7rem 0 0.7rem;
            background: #fff;
        }

        .activityImg {
            width: 4.825rem;
            height: 4.825rem;
            border-radius: 0.3rem;
            margin-right: 0.8rem;
        }

        .showImg {
            width: 100%;
            height: 100%;
        }

        .activityContent {
            height: 4.825rem;
            position: relative;
        }

        .activityTitle {
            color: #333;
            font-size: 0.8rem;
            margin-bottom: 0.2rem;
        }

        .box {
            margin-bottom: 0.25rem;
            height: 0.65rem;
            line-height: 0.65rem;
            display: flex;
            align-items: center;
        }

        .destination,
        .activityTime {
            color: #999;
            font-size: 0.65rem;
        }

        .logo1 {
            width: 0.65rem;
            height: 0.65rem;
            background: url('__IMG__location.png') no-repeat center center;
            background-size: 100% 100%;
            margin-right: 0.2rem;
        }

        .logo2 {
            width: 0.65rem;
            height: 0.65rem;
            background: url('__IMG__clock.png') no-repeat center center;
            background-size: 100% 100%;
            margin-right: 0.2rem;
        }

        .report {
            padding-top: 0.5rem;
            width: 100%;
            position: absolute;
            bottom: 0;
        }

        .signUp {
            text-align: right;
            font-size: 0.65rem;
            color: #FFBA71;
            padding-top: 20px;
        }

        .signUp1 {
            text-align: right;
            font-size: 0.65rem;
            color: #24A8FC;
            padding-top: 1rem;
        }

        .signUp2 {
            text-align: right;
            font-size: 0.65rem;
            color: #999;
            padding-top: 1rem;
        }

        .xian {
            width: 0.75rem;
            height: 0.75rem;
            display: inline-block;
            vertical-align: middle;
        }

        .moreActivity {
            width: 100%;
            height: 2.7rem;
            line-height: 2.7rem;
            color: #999;
            font-size: 0.7rem;
            text-align: center;
        }

        .juli {
            margin-bottom: 0.5rem;
        }

        .activityDetails {
            padding: 0.75rem 0 0.75rem 0;
        }

        .jiangzuo {
            border-radius: 0.2rem;
            color: #ccc;
            font-size: 20px;
            padding: 0.2rem 0.5rem;
            display: inline-block;
            border: 1px solid #E6E6E6;
            font-weight: normal;
            transform-origin: bottom left;
            -webkit-transform-origin: bottom left;
            -ms-transform-origin: bottom left;
            -moz-transform-origin: bottom left;
            -o-transform-origin: bottom left;
            transform: rotate(7deg);
            -ms-transform: scale(0.5);
            /* IE 9 */
            -moz-transform: scale(0.5);
            /* Firefox */
            -webkit-transform: scale(0.5);
            -o-transform: scale(0.5);
        }

        input[type="text"] {
            display: inline-block;
            background: none !important;
        }
    </style>
</head>
<body>
<header class="aui-bar aui-bar-nav underLine"
        style="padding-top:25px;background-color:#FFFFFF;position:fixed;top:0;left:0;" id="header">
    <input type="hidden" name="keyword" value="{$keyword}">
    <a class="aui-pull-left" tapmode="active" onclick="api.closeWin()"> <span class="aui-iconfont aui-icon-tu"> </span>
    </a>
    <div class="aui-title">
        <div class="aui-searchbar" id="search" style="position:relative">
            <div class="aui-searchbar-input aui-border-radius">
                <div style="" onclick="search()">
                    <span class="aaa" id="aaa">搜机构</span>
                    <input type="text" name="jigou" value="{$keyword}">

                </div>
            </div>
        </div>
    </div>
    <a class="aui-pull-right">
        <span class="aui-iconfont aui-icon-rightu" tapmode="active" onclick="right()">搜索</span>
    </a>
    <div class="shaa" id="shaa">
        <div class="underLine" onclick="sousou(this,1)">
            搜活动
        </div>
        <div class="" onclick="sousou(this,2)">
            搜机构

        </div>
    </div>
</header>

<div class="warrp" style="margin-top:3.65rem;">
    <div class="upOrDown">
        <div class="upOrDown_data">
            {volist name="list" id="vo"}
            <div class="cooc underLine" id="{$vo.mechanism_id}">
                <div class="header">
                    <img src="{$vo.mechanism_logo}" alt="">
                </div>
                <div class="right flex-con" style="margin-left:0.8rem">
                    <div class="title aui-ellipsis-1">
                        {$vo.mechanism_name}
                    </div>
                    <div class="cont aui-ellipsis-1" style="margin-top:0.5rem">
                        {$vo.mechanism_intro}
                    </div>
                </div>
            </div>
            {/volist}
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__dropload.min.js"></script>

<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>

<script type="text/javascript">
    var UIInput;
    var getValue = '';
    var shu = 0;


    function right() {
        location.href='{:url("First/mechanism")}?type=2&keyword='+keyword;
    }
    function search() {
        if (shu == 0) {
            $api.byId('shaa').style.display = "block";
            shu = 1;
        } else {
            $api.byId('shaa').style.display = "none";
            shu = 0;
        }
    }
    function sousou(el, type) {
        if (type == 2) {
            location.href = '{:url("First/sactivity")}?type=2';
        } else if (type == 1) {
            location.href = '{:url("First/search")}?type=1';
        }

        document.getElementById('aaa').innerText = el.innerText;
        document.getElementById('shaa').style.display = "none";
        shu = 0;
        var patt1 = new RegExp("活动");
        if (patt1.test(el.innerText)) {
            leixing = "活动"
        } else {
            leixing = "机构"
        }

    }
</script>
<script>
    var page = 1;

    /**
     * 上拉加载，下拉刷新
     */
    var dropload = $('.upOrDown').dropload({
        scrollArea: window,
        autoLoad: true,
//        domUp : {
//            domClass   : 'dropload-up',
//            domRefresh : '<div class="dropload-refresh">↓下拉刷新-自定义内容</div>',
//            domUpdate  : '<div class="dropload-update">↑释放更新-自定义内容</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中-自定义内容...</div>'
//        },
//        domDown : {
//            domClass   : 'dropload-down',
//            domRefresh : '<div class="dropload-refresh">刷新</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
//            domNoData  : '<div class="dropload-noData">无数据</div>'
//        },
        loadDownFn: function (me) {
            var keyword = $('input[name="keyword"]').val();
            page++;
            $.ajax({
                url: '{:url("First/ajaxmechanism")}',
                data: 'page=' + page + '&type=2&keyword=' + keyword,//
                type: 'POST',
                dataType: 'JSON',
                success: function (data) {
                    var arrLen = data.msg.length;
                    if (arrLen <= 0) {

                        me.lock();
//                         无数据
                        me.noData(true);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    } else {
                        var datas = data.msg;
                        $.each(datas, function (key, v) {
                            var _html = '';

                            _html += '<div class="cooc underLine" id="' + v.mechanism_id + '">' +
                                    '<div class="header">';
                            _html += '<img src="' + v.mechanism_logo + '" alt="">' +
                                    '</div>';
                            _html += '<div class="right flex-con" style="margin-left:0.8rem">' +
                                    '<div class="title aui-ellipsis-1" >' + v.mechanism_name + '</div>';
                            _html += '<div class="cont aui-ellipsis-1" style="margin-top:0.5rem">"' + v.mechanism_intro + '"</div>' +
                                    '</div>' +
                                    '</div>';
                            $(".upOrDown_data").append(_html);

                        });
//                        $('.upOrDown_data').append(data);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }
                    $('.cooc').click(function () {
                        var id = $(this).attr('id');
                        location.href = '{:url("Mechanism/mechanismDetail")}?id=' + id;
                    });
                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        },
        loadUpFn: function (me) {
            var keyword = $('input[name="keyword"]').val();

            page = 1;
            $.ajax({
                url: '{:url("First/ajaxmechanism")}',
                data: 'page=' + page + '&type=2&keyword=' + keyword,
                type: 'POST',
                dataType: 'json',
                success: function (data) {
                    $('.upOrDown_data').empty();//
                    var datas = data.msg;
                    $.each(datas, function (key, v) {
                        var _html = '';

                        _html += '<div class="cooc underLine"><div class="header">';
                        _html += '<img src="' + v.mechanism_logo + '" alt="">' +
                                '</div>';
                        _html += '<div class="right flex-con" style="margin-left:0.8rem">' +
                                '<div class="title aui-ellipsis-1" >' + v.mechanism_name + "</div>";
                        _html += '<div class="cont aui-ellipsis-1" style="margin-top:0.5rem">"' + v.mechanism_intro + '"</div>' +
                                '</div>' +
                                '</div>';
                        $(".upOrDown_data").append(_html);
                    });
                    me.resetload();
                    me.unlock();
                    me.noData(false);
                    $('.cooc').click(function () {
                        var id = $(this).attr('id');
                        location.href = '{:url("Mechanism/mechanismDetail")}?id=' + id;
                    });
                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    me.resetload();
                }
            });
        }
    });
</script>
</html>
